RAIS  3.2
C:/Projekte/RAIS/ApplicationLogiLayer/SealedSourceCollection.cs
Go to the documentation of this file.
00001 using System;
00002 using System.Collections.Generic;
00003 using System.Text;
00004 using System.ComponentModel;
00005 using RAIS.Common;
00006 using RAIS.DataAccessLayer;
00007 
00008 namespace RAIS.ApplicationLogicLayer
00009 {
00010     public class SealedSourceCollection : BindingList<SealedSource>
00011     {
00015         public DateTime CalculationDate
00016         {
00017             set 
00018             {
00019                 foreach (SealedSource item in this)
00020                     item.CalculationDate = value;
00021             }
00022             get
00023             {
00024                 if (this.Count == 0)
00025                     return DateTime.Now.Date;
00026                 else
00027                     return this[0].CalculationDate;
00028             }
00029         }
00034         public SealedSourceCollection(DateTime calculationDate,int userID)
00035         {
00036             Add(new SealedSource());
00037             using (SealedSourceData sealedSource = new SealedSourceData(userID))
00038                 while (sealedSource.Reader.Read())
00039                     Add(new SealedSource(sealedSource.Reader, calculationDate));
00040         }
00041     }
00042 }